package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.WareSkuTo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author DuGuanghan
 * @since 2024-03-05 09:50:51
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    /**
     * 分页查询
     *
     * @param params 参数
     * @return {@link PageUtils }
     * @author DuGuanghan
     * @since 2024-03-05 09:50:59
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 更新仓库库存
     * @param wareId 仓库ID
     * @param skuId  SKU ID
     * @param skuNum SKU库存量
     * @author DuGuanghan
     * @since 2024-03-14 11:26:54
     */
    void updateSkuNum(Long wareId, Long skuId, Integer skuNum);

    /**
     * 获取sku的库存信息
     *
     * @param skuIds SKU ID
     * @return {@link List }<{@link WareSkuTo }>
     * @author DuGuanghan
     * @since 2024-04-07 16:51:03
     */
    List<WareSkuTo> getSkuHasStock(List<Long> skuIds);
}

